<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>GroupClose</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>GroupClose</h1>

<p>Closes the active window if it was just activated by <a href="GroupActivate.htm">GroupActivate</a> or <a href="GroupDeactivate.htm">GroupDeactivate</a>. It then activates the next window in the series. It can also close all windows in a group.</p>

<pre class="Syntax">GroupClose, GroupName [, A|R]</pre>
<h3>Parameters</h3>
<dl>

  <dt>GroupName</dt>
  <dd><p>The name of the group as originally defined by <a href="GroupAdd.htm">GroupAdd</a>.</p></dd>

  <dt>A|R</dt>
  <dd><p>If it's  the letter A, all members of the group will be closed. This is the same effect as <code><a href="WinClose.htm">WinClose</a> ahk_group GroupName</code>.</p>
      <p>Otherwise: If the command closes the active window, it will then activate the next window in the series. This parameter  determines whether the oldest or the newest window is activated. If omitted, the oldest window is always activated. If it's the letter R, the newest window (the one most recently active) is activated, but only if no members of the group are active when the command is given. &quot;R&quot; is useful in cases where you temporarily switch to working on an unrelated task. When you return to the group via <a href="GroupActivate.htm">GroupActivate</a>, <a href="GroupDeactivate.htm">GroupDeactivate</a>, or <a href="GroupClose.htm">GroupClose</a>, the  window you were most recently working with is activated rather than the oldest window.</p></dd>

</dl>

<h3>Remarks</h3>
<p>When the <em>A|R</em> parameter is not &quot;A&quot;, the behavior of this command is determined by whether the previous action on <em>GroupName</em> was <a href="GroupActivate.htm">GroupActivate</a> or <a href="GroupDeactivate.htm">GroupDeactivate</a>.  If it was <a href="GroupDeactivate.htm">GroupDeactivate</a>, this command will close the active window only if it is <strong>not</strong> a member of the group (otherwise it will do nothing). If it was <a href="GroupActivate.htm">GroupActivate</a> or nothing, this command will close the active window only if it <strong>is</strong>  a member of the group (otherwise it will do nothing). This behavior allows GroupClose to be assigned to a hotkey as a companion to <em>GroupName</em>'s <a href="GroupActivate.htm">GroupActivate</a> or <a href="GroupDeactivate.htm">GroupDeactivate</a> hotkey.</p>
<p>See <a href="GroupAdd.htm">GroupAdd</a> for more details about window groups.</p>
<h3>Related</h3>
<p><a href="GroupAdd.htm">GroupAdd</a>, <a href="GroupActivate.htm">GroupActivate</a>, <a href="GroupDeactivate.htm">GroupDeactivate</a></p>
<h3>Example</h3>
<pre class="NoIndent">GroupClose, MyGroup, R</pre>

</body>
</html>
